Skip to content

Fix Environment secret forwarding and block shared-credential fallback - #7

Merged
AppSolves merged 3 commits into
mainfrom
fix/environment-secret-forwarding
Nov 14, 2026
Merged

AppSolves merged 3 commits into
mainfrom
fix/environment-secret-forwarding

Conversation

@AppSolves

@AppSolves AppSolves commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Literal empty secret grants left credentials empty even when the called job selected the correct protected Environment. Generate GitHub's named secret references instead, preceded by a required caller job with no Environment that rejects nonempty repository/organization credentials under either name. Only a boolean reaches the guard process; failures block the reusable workflow. This prevents shared-secret fallback while retaining Environment-only ownership.

Real GitHub Actions verification with synthetic canaries passed all six contract cases: empty literal, omitted grant, Environment-only named reference, Environment precedence, unsafe repository fallback, and environment-free scope visibility. Evidence: https://github.com/AppSolves/codexbot/actions/runs/43602684286. Temporary synthetic secrets and Environments were removed; the probe commit is linked in docs/validation.md. No real credentials, inference or deployment were used.

Validation: Node 24 npm run check (124 tests, typecheck, lint, build), independent npm run test:clean, actionlint for repository/generated/consumer workflows and git diff --check passed. Regression tests execute the guard, reject malformed inputs, enforce dependency/permissions/boolean-only mapping and keep the manual example aligned. The previous empty-grant assertions and documentation were incorrect and are replaced.

The reusable workflow and Worker authorization handlers are unchanged. Keep the existing immutable pin 4ed668864cac0682e09ec49a2515a6e1893a2780; repairing an existing caller needs no deployment, migration, OAuth reconnect or pin rollout. The generator is shared with hosted /v1/setup: future hosted setup templates require a separately authorized Worker bundle deployment, preserving this same trusted workflow pin. Existing installations must update their caller through a normal reviewed PR and freshly dispatch credential_check_only on the protected default branch. The canary test does not claim that installation's OAuth or inference success. No automatic merge or protection bypass.

Concurrency regression follow-up: select the actually fulfilled Store.create result and assert its terminal transition succeeds. Related run/session claim tests also follow the winning claim, preserving one-winner, replay, rotation and authorization assertions. No production safeguards changed. Forcing the alternate contender to win reproduced the baseline failure and passed with the fix. The two affected test files passed 100/100 repetitions (1,900 test executions); full check passed 124 tests, typecheck/lint/build, and independent test:clean passed. Both independent full CI runs passed on commit 6b6b918: push, pull request. Ready for normal approval/merge. No merge, deployment, credential changes or inference is performed by this follow-up.

@AppSolves
AppSolves merged commit a0c5adf into main Nov 14, 2026
4 checks passed
@AppSolves
AppSolves deleted the fix/environment-secret-forwarding branch November 14, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant